// require('dotenv').config(); 
export default {
  // env: {
  //   API_URL: process.env.API_URL 
  // },
  server: {
    host: '0.0.0.0', 
    port: 3000 
  },
  router: {
    extendRoutes(routes, resolve) {
      routes.push({  
        path: '/news/:suffix?.html',
        redirect: to => {  
          return '/news';  
        }  
      });
      routes.push({
        name: 'news-id',
        path: '/news/:id',
        component: resolve(__dirname, 'pages/news/_id.vue')
      })
      routes.push({
        name: 'news-page',
        path: '/news',
        component: resolve(__dirname, 'pages/news.vue')
      })
      routes.push({
        name: 'indexsearch_with_id',
        path: '/indexsearch_0_:id(\\d+)_0_0.html',
        component: resolve(__dirname, 'pages/indexsearch.html.vue'),
      });
    }
  },
  head: {
    title: '77乐园',
    htmlAttrs: {
      lang: 'en'
    },
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { hid: 'description', name: 'description', content: '' },
      { name: 'format-detection', content: 'telephone=no' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1.0, user-scalable=no' }
    ],
    link: [
      { rel: 'icon', type: 'image/x-icon', href: '/20241012-173823.ico' },
      { rel: 'stylesheet', href: 'https://cdn.quilljs.com/1.3.6/quill.snow.css' }
    ],
    script: [
      { src: 'https://cdn.quilljs.com/1.3.6/quill.js', type: 'text/javascript' },
      { src: 'https://unpkg.com/node-vibrant@0.3.0/dist/vibrant.min.js', type: 'text/javascript' },
      { src: 'https://hm.baidu.com/hm.js?fe2ca92535c52cf33a1faad4b3cfd183' }
    ],
  },
  css: [
    'vant/lib/index.css',
    "@/static/fonts/fonts.css"
  ],
  plugins: [
    '@/plugins/vant',
    '~/plugins/axios',
    '~/plugins/crypto.js',
    '~/plugins/config.js',
    '~/plugins/image-modal.js',
     '~/plugins/baidu.js'
    
  ],
  buildModules: [
  ],
  modules: [
    '@nuxtjs/axios',
    '@nuxtjs/proxy'
  ],
  axios: {
    proxy: true,
    prefix: '/aa',
  },
  proxy: {
    "/aa": {
      target: "https://www.77.top/",
      // target: "http://beta.www.77.top/",
      changeOrigin: true,
                  secure: true,
      pathRewrite: {
        "^/aa": "",
      },
    },
  },
  build: {
    // 防止多次打包
    vendor: ["axios"]
  },
  
}
